﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.views.popups.missions {
    import reprise.ui.*;
    import net.wooga.pets.models.world.vos.*;
    import net.wooga.pets.models.*;
    import net.wooga.pets.constants.*;
    import net.wooga.pets.utils.*;

    public class MissionTasksPopUpMediator_W extends MissionTasksPopupMediator {

        override protected function setContent():void{
            var _local4:TaskVO;
            var _local6:Object;
            if (_mission.isLevelMission){
                _speakerLinkage = "Missions_Karla";
            };
            var _local1:UIComponent = RepriseUtils.addComponent(view, "tasksContent");
            var _local2:Array = _mission.tasks;
            var _local3 = 1;
            for each (_local4 in _local2) {
                var _temp1 = _local3;
                _local3 = (_local3 + 1);
                setTask(_temp1, _local4, _local1);
            };
            if (tutorialModel.state <= TutorialModel.ROOMTUTORIAL_FINISH_TUTORIAL){
                closeButton.hide();
            };
            var _local5 = "global_button_ok";
            switch (true){
                case hasMissionOfType(GameConstants.GET_ACHIEVEMENT):
                    _local5 = "global_open_achievements";
                    _local6 = {type:EventConstants.CREATE_POPUP, id:GameConstants.ACHIEVEMENT_BOOK_POPUP};
                    break;
            };
            setOkButton(_local5, _local6);
        }
        override protected function addHint(_arg1:String, _arg2:int, _arg3:UIComponent):void{
            var _local4:String = language.getTextByKey(_arg1, {amount:_arg2});
            switch (true){
                case (_local4 == "Hint: Check the computer"):
                case (_local4 == "Tipp: Schau in den Computer"):
                case (_local4 == "Astuce: Clique sur l'ordi"):
                case (_local4 == "Consiglio: Clicca sul computer"):
                case (_local4 == "İpucu: Bilgisayarı kontrol et"):
                case (_local4 == "İpucu: Bilgisayara göz at"):
                case (_local4 == "Consejo: Revisa el ordenador"):
                case (_local4 == "Dica: verifique o computador"):
                case (_local4 == "Dica: cheque o computador"):
                    _local4 = language.getTextByKey("mission_task_hint_queue");
                    break;
            };
            RepriseUtils.addLabel(_arg3, "taskBody myriadProFont", _local4);
        }

    }
}//package net.wooga.pets.views.popups.missions 
